require 'rho/rhocontroller'
require 'helpers/browser_helper'

class EventsController < Rho::RhoController
  include BrowserHelper

def asynchttp1
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

  def httpget_callback
    $x = Array.new 
    
    $x = @params['body']
   # puts "@@x : #{@@x}"
  WebView.navigate ( url_for :action => :show_result )
  end

  def show_result
    render :action => :viewhttp
  end


def asynchttp2
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp3
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp4
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=inscription&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp5
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=marathon&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp6
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp7
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp8
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp9
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp10
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp11
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp12
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp13
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end

def asynchttp14
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp15
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp16
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp17
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp18
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp19
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp20
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp21
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp22
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end
def asynchttp23
    Rho::AsyncHttp.get(
    :url => 'http://oprotech.net/onroad/_inc/index.php?action=events_info&var1=footlose&key=manglik',
    :callback => (url_for :action => :httpget_callback),
    :callback_param => '' )

    render :action => :wait
  end


  #GET /Events
  def index
    @eventses = Events.find(:all)
		render
  end

  # GET /Events/{1}
  def show
    @events = Events.find(@params['id'])
    if @events
      render :action => :show, :back => '/Events'
    else
      redirect :action => :index
    end
  end

  # GET /Events/new
  def new
    @events = Events.new
    render :action => :new
  end

  # GET /Events/{1}/edit
  def edit
    @events = Events.find(@params['id'])
    if @events
      render :action => :edit
    else
      redirect :action => :index
    end
  end

  # POST /Events/create
  def create
    @events = Events.create(@params['events'])
    redirect :action => :index
  end

  # POST /Events/{1}/update
  def update
    @events = Events.find(@params['id'])
    @events.update_attributes(@params['events']) if @events
    redirect :action => :index
  end

  # POST /Events/{1}/delete
  def delete
    @events = Events.find(@params['id'])
    @events.destroy if @events
    redirect :action => :index
  end
end
